package com.macro.mall.config;


import com.baidu.aip.ocr.AipOcr;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 百度 orc
 * Created by lx on 2020/5/8.
 */
@Configuration
public class BaiduOcrConfig {


    public static final String APP_ID = "19776701";//你的 App ID
    public static final String API_KEY = "1boLx2hozQVqQ6un5cR3NntR";//你的 Api Key
    public static final String SECRET_KEY = "q8rwhzIs3fWrrNTrk3OKsxzKV5xebAur";//你的 Secret Key

    /**
     * 允许跨域调用的过滤器 http://ai.baidu.com/ai-doc/OCR/Uk3h7ycj5
     */
    @Bean
    public AipOcr aipOcr() {
        // 初始化一个AipOcr
        AipOcr client = new AipOcr(APP_ID, API_KEY, SECRET_KEY);
        // 可选：设置网络连接参数
        client.setConnectionTimeoutInMillis(2000);
        client.setSocketTimeoutInMillis(60000);
        return client;
    }


}
